var app = getApp();

Component({
    properties: {
        textOne: {
            type: String
        },
        inMenuItemData: {
            type: Array
        }
    },

    data: {
        baseUrl: app.globalData.baseUrl,
        listClickId: -1,
        listData: [
            {
                index: 0,
                id: "man",
                name: "男性",
                genderId: 0,
                imgUrl: "/boxIndex/frame-man.png",
                imgUrlSelect: "/boxIndex/frame-man-select.png"
            },
            {
                index: 0,
                id: "woman",
                name: "女性",
                genderId: 1,
                imgUrl: "/boxIndex/frame-woman.png",
                imgUrlSelect: "/boxIndex/frame-woman-select.png"
            },
            {
                index: 0,
                id: "null",
                name: "不告诉你",
                genderId: 2,
                imgUrl: "/boxIndex/frame-null-man.png",
                imgUrlSelect: "/boxIndex/frame-null-man-select.png"
            }
        ],
        frameAnimation: null
    },

    attached() {

    },

    methods: {
        tabItemClick(e) {
            // if (app.globalData.gPartsMenuDatas == null) {
            //     jd.showToast({
            //         title: "您还没有授权登录。",
            //         duration: 1500
            //     })
            //     return;
            // }

            let id = e.currentTarget.dataset.data;
            this.setData({
                listClickId: id
            })
            let _self = this;
            jd.showLoading();
            setTimeout(() => {
                jd.hideLoading();
                this.setData({
                    listClickId: -1
                })
                this.triggerEvent("onGenderSelect", { gender: id });
            }, 1000);
        },

        startFrameAni() {
            // frame ani
            var tempFrameAnimation = jd.createAnimation({
                duration: 500,
                timingFunction: 'cubic-bezier(0,0.14,1,0.18)',
                delay: 0
            });
            tempFrameAnimation.opacity(1.0).translate(0, 100).step()
            this.setData({
                frameAnimation: tempFrameAnimation.export()
            })
            // end ani
        },

        animationEndFun() {
            console.log("animationEndFun --- animationEndFun")
            this.triggerEvent("onBottomAniEnd", {});
        }
    },
})